﻿'/*
'openEco grasshopper components 0.000.1
'ben howes  110811
' */

 Imports Grasshopper.Kernel
 Imports Grasshopper.Kernel.Types
 Imports Rhino.Geometry
 
 
 Public Class MeshExport
 	
 	Inherits GH_Component
 	
 	''add new constructor
 	Public Sub New()
 		''for sharpDevelop users ...  don't know why intellisense doesn't work with the new constructor..
 		''MyBase.New("Component Name", "Component Abbreviation", "Description", "Category", "Sub-Category")

		MyBase.New("Mesh Export", "OpenEcoMeshExport", "Exports mesh geometry to Ecotect as analysis objects", "OpenEco", "Geometry")

 	End Sub
	
 	
 	Protected Overrides Sub SolveInstance(DA As IGH_DataAccess)
 		
 		Dim startBool As Boolean = Nothing
		
		If (Not DA.GetData(0, startBool)) Then Return
		If (startBool = Nothing) Then Return
	
		If (startBool = True) Then
			MsgBox("Build Mesh Export Functinoality here")
		End If
	End Sub
 	
	Protected Overrides Sub RegisterOutputParams(pManager As GH_Component.GH_OutputParamManager)
		''0 -- the run switch - true if run is successful
		pManager.Register_BooleanParam("Export Successful?", "E?", "True if export completes successfully")
		
		''1 -- the object ID data tree for use in object attribute retreival
		pManager.Register_IntegerParam("Object IDs", "ObjID", "The Object IDs for use in object attributes node")
	
	End Sub
 	
 	Protected Overrides Sub RegisterInputParams(pManager As GH_Component.GH_InputParamManager)
 		''0 -- the run parameter
 		pManager.Register_BooleanParam("Export?", "Ex", "If true, mesh is exported to Ecotect as panel objects", False)
 		
 		''1 -- the analysis mesh
 		pManager.Register_MeshParam("Analysis Mesh", "aM", "The mesh to export for analysis")
 		
 		''2 -- the context mesh (optional)
 		pManager.Register_MeshParam("Shading Mesh", "cM", "The mesh to use for shading, obstructions, etc.")
 		
 		''3 -- the scale factor (optional)
 		pManager.Register_DoubleParam("Scale factor", "S", "Ecotect units = MM. Enter (optional) scale factor to match your rhino units", 1.0)
	End Sub
 	
	Public Overrides ReadOnly Property ComponentGuid() As System.Guid
		Get
			''TO DO: CREATE A LEGIT GUID!!
			Return New Guid("fa77cb9d-272f-4846-82df-1bf1fd8dbb69")
		End Get
	End Property
End Class
